<template lang="">
  <div>
    <mt-swipe :show-indicators="true" :speed="300" :auto="5000" :style="{height:h}">
      <mt-swipe-item name="img A">
        <img src="/images/1.jpg" alt=""/>
      </mt-swipe-item>
      <mt-swipe-item name="img B">
        <img src="/images/2.jpg" alt=""/>
      </mt-swipe-item>
      <mt-swipe-item name="img C">
        <img src="/images/3.jpg" alt=""/>
      </mt-swipe-item>
    </mt-swipe>
  </div>
</template>
<script>
export default {
  data() {
    return {
      h:'210px'
    }
  },
  mounted(){
    //计算当前屏幕宽度下，轮播图的高度， 设置data.h
    let picw = 1242;
    let pich = 698;
    let screenw = window.screen.width;
    let swipeh = ((pich*screenw)/picw)+'px';
    this.h = swipeh;
  }
}
</script>
<style scoped>
  img{
    width:100%
  }
</style>